﻿using SUNRPA.CONTROLS.IMPL.domain.attrubutes;
/// <summary>
/// Excel有Office和Wps目前只支持Office后期加入Wps支持。
/// </summary>
namespace SUNRPA.CONTROLS.IMPL.domain.flowItemParam {
    [Serializable]
    public class SwitchCellDataTypeNParam:BaseParam {
        private string writeObjectName = "{excelObject}";
        //改变范围0列，1行，2单元格，3区域，4已使用区域
        private int range = 0;
        //目标格式0整数，1字符串，2小数，3、百分比
        private int targetType = 0;
        private string row = "";
        private string column = "";
        private string endRow = "";
        private string endColumn = "";
        private string sheetName = "";
        //精度
        private string precision;
        public string Precision {
            get => precision; 
            set { 
                precision = value;
                NotifyPropertyChanged("WriteObjectName");
            }  
        }
        public int Range {
            get => range; 
            set { 
                range = value;
                NotifyPropertyChanged("Range");
            }  
        }
        public int TargetType {
            get => targetType; 
            set { 
                targetType = value;
                NotifyPropertyChanged("TargetType");
            }  
        }
        public string WriteObjectName {
            get => writeObjectName; 
            set { 
                writeObjectName = value;
                NotifyPropertyChanged("WriteObjectName");
            }  
        }
        public string EndRow {
            get => endRow; 
            set { 
                endRow = value;
                NotifyPropertyChanged("EndRow");
            }  
        }

        public string EndColumn {
            get => endColumn; 
            set { 
                endColumn = value;
                NotifyPropertyChanged("EndColumn");
            }  
        }
        public string Row {
            get => row; 
            set { 
                row = value;
                NotifyPropertyChanged("Row");
            }  
        }
        public string Column {
            get => column; 
            set { 
                column = value;
                NotifyPropertyChanged("Columns");
            }
}
        public string SheetName {
            get => sheetName; 
            set { 
                sheetName = value;
                NotifyPropertyChanged("SheetName");
            }  
        }
        public string GetTranslateItemInfo() {
            switch(this.range) {
                case 0:
                    return $"第{column}列";
                case 1:
                    return $"第{row}行";
                case 2:
                    return "（第" + row + "行，第" + column + "列）的单元格";
                case 3:
                    return $"（{row}，{column}，{endRow}，{endColumn}）区域内";
                case 4:
                    return "已使用区域";
                default : return "";
            }
        }
        public string GetTranslateTargetType() {
            switch(this.range) {
                case 0:
                    return "整数";
                case 1:
                    return "字符串";
                case 2:
                    return "小数";
                case 3:
                    return "百分比";
                default : return "整数";
            }
        }
    }
}
